package String.StringDemo;

public class 字符串反转 {
    public static void main(String[] args) {
        String s="abc";
        System.out.println(reverse(s));
    }
    public static String reverse(String s){
        String result="";
        for (int i = s.length()-1; i >= 0; i--) {
            result+=s.charAt(i);
        }
        return result;
    }

}
